//
//  MessageModel.swift
//
//  Created by Icy on 2017/1/11
//  Copyright (c) . All rights reserved.
//

import Foundation
import SwiftyJSON
import ModelProtocol

 class MessageModel: ModelProtocol {

    // MARK: Declaration for string constants to be used to decode and also serialize.
	internal let kMessageMessageKey: String = "message"


    // MARK: 属性
	 var message: String!


    // MARK: 实现MikerSwiftJSONAble 协议， 解析json数据
    required  init?(json: JSON) {
		message = json[kMessageMessageKey].stringValue

    }


    /**
    Generates description of the object in the form of a NSDictionary.
    - returns: A Key value pair containing all valid values in the object.
    */
    internal func dictionaryRepresentation() -> [String : AnyObject ] {

        var dictionary: [String : AnyObject ] = [ : ]
		if message != nil {
			dictionary.updateValue(message! as AnyObject, forKey: kMessageMessageKey)
		}

        return dictionary
    }


}
